﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BUS;

namespace QLNS
{
    public partial class BangDangNhap : DevExpress.XtraEditors.XtraForm
    {
        public BangDangNhap()
        {
            InitializeComponent();
        }

        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            // khai bao bien
            string username = txtUsername.Text.Trim();
            string password = txtPassword.Text.Trim();

            if (UserBUS.DangNhap(username, password))
            {
                GiaoDienChinh giaoDienChinh = new GiaoDienChinh();
                giaoDienChinh.ShowDialog();
            }
            else
            {
                MessageBox.Show("Dang nhap that bai!");
                txtUsername.Text = "";
                txtPassword.Text = "";
                txtUsername.Focus();
            } // ket thuc else
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}